<?php
include "../../public/config/config.php";
include "../../public/include/funcs.php";
$link=conn($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$cfg_dbname,$cfg_dbchar);
$date = date("Ymd");
$arr = select($link, 'diy_hc', "date=".$date);
if(!$arr){
	$re = add($link, 'diy_hc', ['date' => $date, 'num1' => 1]);
	$arr = select($link, 'diy_hc', "date=".$date);
}
foreach($arr[0] as $k=>$v){
	if(preg_match("/num/", $k)){
		$arr_num[$k] = $v;
	}
}
echo json_encode($arr_num);



// var_dump($arr);
// echo "<pre>";
// print_r($arr);
// echo "</pre>";
?>